package cn.com.klun.tjy.dubbo.Impl;

import cn.com.klun.tjy.dubbo.MainForceEffectStockService;
import cn.com.klun.tjy.dubbo.bean.TjyParametersVo;
import cn.com.klun.tjy.service.MainOrderEffectService;
import com.alibaba.dubbo.rpc.RpcContext;
import com.google.common.base.Throwables;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.lang.reflect.Method;

/**
 * @Title: MainForceEffectStockImpl.java
 * @Description: 主力影响
 */
@Service
public class MainForceEffectStockServiceImpl implements MainForceEffectStockService {

    private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());

    @Autowired
    private MainOrderEffectService mainOrderEffectService;

    @Override
    public TjyParametersVo getEffect(TjyParametersVo vo) {
        String clientIp = RpcContext.getContext().getRemoteHost();
        //logger.info("财富管理,记账服务,客户端IP：{}, vo：{}", clientIp, vo);
        try {
            vo = mainOrderEffectService.service(vo);
        } catch (Exception e) {
            logger.error("主力影响服务提供者出错,日志关联Key:{},异常：{}",vo.getLogAndKey(), Throwables.getStackTraceAsString(e));
            vo.setResDesc("主力影响服务提供者出错,调用异常");
        }
        return vo;
    }
}
